<template>
  <div class="module_">
      <!-- 月度绩效评估
      <el-select v-model="value" placeholder="请选择" v-loadMore='{loadMore,finished,loading}'>
        <el-option
          v-for="(item,index) in list"
          :key="index"
          :label="item.name"
          :value="item.id">
        </el-option>
      </el-select> -->
  </div>
</template>

<script>
import {Apidepartments} from '@/api'
export default {
  data(){
    return{
      options:{
        page: 1,
        perPage: 20,
      },
      value: "",
      list: [],
      finished: false,
      loading: false,
    }

  },
  mounted(){
    this.getList(true)
  },
  methods:{
    loadMore(){
      this.options.page++
      this.getList()
    },
    getList(flag){
      if(flag) this.options.page = 1
      this.loading = true
      Apidepartments(this.options).then( ({data,page})=>{
        this.loading = false
        this.list = flag ? (data || []) : this.list.concat(data)
        this.finished = this.list.length === page.total
      })
    } 
  }
}
</script>

<style>

</style>